package com.sanerzone.smscenter.modules.sms.entity;

import com.sanerzone.jeebase.common.utils.excel.annotation.ExcelField;

/**
 * Created by yy on 2018/5/9.
 */
public class SmsSendPhoneExcel {

    private String phone;

    private String taskid;

    private String sendStatus;

    private String gatewayStatus;

    private String status;

    @ExcelField(title="手机号码", align=2, sort=20)
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @ExcelField(title="提交单号", align=2, sort=10)
    public String getTaskid() {
        return taskid;
    }

    public void setTaskid(String taskid) {
        this.taskid = taskid;
    }

    public String getSendStatus() {
        return sendStatus;
    }

    public void setSendStatus(String sendStatus) {
        this.sendStatus = sendStatus;
    }

    public String getGatewayStatus() {
        return gatewayStatus;
    }

    public void setGatewayStatus(String gatewayStatus) {
        this.gatewayStatus = gatewayStatus;
    }

    @ExcelField(title="状态", align=2, sort=30)
    public String getStatus() {
        return status;
    }

    public void setStatus() {
        if (sendStatus.startsWith("F")) {
            this.status = "失败";
        } else if (sendStatus.startsWith("T") && gatewayStatus.startsWith("T")) {
            this.status = "成功";
        } else if (sendStatus.startsWith("T") && gatewayStatus.startsWith("F")) {
            this.status = "失败";
        } else {
            this.status = "待处理";
        }
    }
}
